package com.hwadee.service.impl;

import com.hwadee.mapper.DoctorMapper;
import com.hwadee.pojo.Doctor;
import com.hwadee.service.DoctorService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoctorServiceImpl implements DoctorService {
    @Resource
    private DoctorMapper doctorMapper;
    //查询所有医生信息，并统计其绑定的老人数量
    @Override
    public List<Doctor> getAllDoctors() {
        return doctorMapper.getAllDoctorsWithElderlyCount();
    }
    //根据医生 ID 查询医生的基本信息
    @Override
    public Doctor getDoctorById(Integer id) {
        return doctorMapper.getDoctorById(id);
    }
    //查询该医生绑定的所有老年人姓名
    @Override
    public List<String> getBoundElderNames(Integer doctorId) {
        return doctorMapper.getBoundElderNames(doctorId);
    }

}
